package com.woniuxy.business.service.impl;

import com.woniuxy.business.mapper.PreLoanMapper;
import com.woniuxy.business.service.PreLoanService;
import com.woniuxy.entity.PreLoan;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 贷前管理的service接口是实现
 */
@Service
public class PreLoanServiceImpl implements PreLoanService {
    @Resource
    private PreLoanMapper preLoanMapper;

    //添加
    @Override
    public void addPreLoan(PreLoan preLoan) {
        preLoanMapper.insertPreLoan(preLoan);
    }

    //删除
    @Override
    public void removePreLoan(Integer id) {
        preLoanMapper.deletePreLoan(id);
    }

    //根据企业id外键查找
    @Override
    public List<PreLoan> getPreLoanByBusinessName(Integer business_id) {
        return preLoanMapper.selectPreLoanByBusinessName(business_id);
    }

    //分页+条件查找
    @Override
    public List<PreLoan> getPreLoanByStatus(String process_status, int pageIndex, int pageSize) {
        return preLoanMapper.selectPreLoanByStatus(process_status, pageIndex, pageSize);
    }
}
